package com.ez.supervise.dao.impl;

import java.util.List;

import com.ez.supervise.core.Page;
import com.ez.supervise.dao.OrgGoalSettingDao;
import com.ez.supervise.dao.base.BaseDaoImpl;
import com.ez.supervise.model.biz.OrgGoalSetting;

public class OrgGoalSettingDaoImpl extends BaseDaoImpl implements OrgGoalSettingDao {

    public void insert(Object goalSelf) {
	sqlMapClientTemplate.insert("biz.insertOrgGoalSetting", goalSelf);
    }

    public Object get(Long id) {
	return (OrgGoalSetting) sqlMapClientTemplate.queryForObject("biz.getOrgGoalSettingById", id);
    }

    public void update(Object org) {
	sqlMapClientTemplate.update("biz.updateOrgGoalSetting", org);
    }

    public void delete(Long id) {
	sqlMapClientTemplate.update("biz.deleteOrgGoalSetting", id);
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.ez.supervise.dao.OrgGoalSettingDao#findByCount(com.ez.supervise.core.Page)
     */
    public int findOrgGoalSettingByCount(Page page) {
	return (Integer) getSqlMapClientTemplate().queryForObject("biz.findOrgGoalSettingByCount", page.getConditions());
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.ez.supervise.dao.OrgGoalSettingDao#findByPage(com.ez.supervise.core.Page)
     */
    public List findOrgGoalSettingByPage(Page page) {
	return getSqlMapClientTemplate().queryForList("biz.findOrgGoalSettingByPage", page.getConditions());
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.ez.supervise.dao.OrgGoalSettingDao#findAll()
     */
    public List findAll() {
	return getSqlMapClientTemplate().queryForList("biz.findAllOrgGoalSetting");
    }

    public int countExistOrgGoalSetting(OrgGoalSetting orgGoalSetting) {
	return (Integer) getSqlMapClientTemplate().queryForObject("biz.countExistOrgGoalSetting", orgGoalSetting);
    }

    public void delOrgGoalSettingByOrgId(Long orgId) {
	getSqlMapClientTemplate().delete("biz.delOrgGoalSettingByOrgId", orgId);
    }

}
